
export default {
  install (Vue, options) {
    Vue.prototype.switchTime  = function (val) {
        if(!val){
            return;
        }
      var date = new Date(val);
     var y = date.getFullYear();
     var m = date.getMonth() + 1;
     m = m < 10 ? ('0' + m) : m;
     var d = date.getDate();
     d = d < 10 ? ('0' + d) : d;
     var h = date.getHours();
     h = h < 10 ? ('0' + h) : h;
     var minute = date.getMinutes();
     var second = date.getSeconds();
     minute = minute < 10 ? ('0' + minute) : minute;
     second = second < 10 ? ('0' + second) : second;
     return y + '-' + m + '-' + d+' '+h+':'+minute+':'+second;
    },
    Vue.prototype.delMessage = function (callback) {
      this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
        }).then(() => {
          callback&&callback()
          // alert()
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消删除'
          });
      });
    }
  }
}
